package com.example;

import org.springframework.beans.factory.annotation.Value;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
@SpringBootApplication
public class Boot1Application {
	@Value("${server.port}")
    private String port;
	
	
	public static void main(String[] args) {
		/*
		 * 启动的三种方式
		SpringApplication.run(Boot1Application.class, args);
		*/
		/*
		SpringApplication app=new SpringApplication(Boot1Application.class);
		app.run(args);
		*/
		new SpringApplication(Boot1Application.class).run(args);
	}
	
	@RequestMapping("/index")
	public String index(){
		return port;
	}

}